package com.huluobo.a2207douyindemo;

import android.app.Application;
import android.util.Log;

import com.huluobo.base.db.AppDBUtils;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMOptions;
import com.hyphenate.easeui.EaseIM;
import com.tencent.live2.V2TXLivePremier;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

/**
 * Created by LC on 2024/9/19.
 */
public class DouYinApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        //友盟初始化
        UMConfigure.init(this, "66ec115d80464b33f6cad281", "umeng", UMConfigure.DEVICE_TYPE_PHONE, "");
        // QQ设置
        PlatformConfig.setQQZone("101830139", "5d63ae8858f1caab67715ccd6c18d7a5");

        //数据库初始化
        AppDBUtils.getInstance().init(this);

        //环信初始化
        EMOptions options = new EMOptions();
        options.setAppKey("moroks#2202douyinkotlindemo");
//        EMClient.getInstance().init(this, options);

        //EaseIM 初始化
        if (EaseIM.getInstance().init(this, options)) {
            //在做打包混淆时，关闭 debug 模式，避免消耗不必要的资源
            EMClient.getInstance().setDebugMode(true);
            //EaseIM 初始化成功之后再调用注册消息监听的代码 ...
        }

        //腾讯云初始化
        String licenceURL = "https://license.vod2.myqcloud.com/license/v2/1330237977_1/v_cube.license"; // 获取到的
        // licence url
        String licenceKey = "3b425f63c2aed7557be3ad464eb34e7a"; // 获取到的 licence key
        V2TXLivePremier.setLicence(this, licenceURL, licenceKey);
        V2TXLivePremier.setObserver(new V2TXLivePremier.V2TXLivePremierObserver() {
            @Override
            public void onLicenceLoaded(int result, String reason) {
                Log.i("TagA", "onLicenceLoaded: result:" + result + ", reason:" + reason);
            }
        });

    }
}
